package org.dromara.patrol.controller;


import lombok.RequiredArgsConstructor;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.dromara.common.core.domain.R;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.patrol.domain.bo.PatrolSnapImgBo;
import org.dromara.patrol.domain.vo.PatrolSnapImgVo;
import org.dromara.patrol.service.IPatrolSnapImgService;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.mybatis.core.page.PageQuery;

/**
 * 巡店管理-抓拍巡店图片
 * 前端访问路由地址为:/patrol/snap/image
 *
 * @author LionLi
 * @date 2024-03-27
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/snap/image")
public class PatrolSnapImgController extends BaseController {

    private final IPatrolSnapImgService patrolSnapImgService;

    /**
     * 查询巡店管理-抓拍巡店图片列表
     */
//    @SaCheckPermission("patrol:snapImg:list")
    @GetMapping("/list")
    public TableDataInfo<PatrolSnapImgVo> list(PatrolSnapImgBo bo, PageQuery pageQuery) {
        return patrolSnapImgService.queryPageList(bo, pageQuery);
    }


    /**
     * 查询巡店管理-抓拍巡店图片列表
     */
//    @SaCheckPermission("patrol:snapImg:list")
    @GetMapping("/{imgId}")
    public R<PatrolSnapImgVo> getImgInfo(@PathVariable Long imgId) {
        return patrolSnapImgService.getImgInfo(imgId);
    }
}
